package com.example.mobifin_busticket.views.dialogs;

import com.example.mobifin_busticket.R;

import android.app.Dialog;
import android.content.Context;
import android.text.Html;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.TextView;

public class TermsAndCondtionDialog extends Dialog implements
		android.view.View.OnClickListener {
	Context mContext;
	TextView tvTermsAndCodition;
	Button btn_ok;

	public TermsAndCondtionDialog(Context context) {
		super(context);
		// TODO Auto-generated constructor stub
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.terms_and_condition_dialog);
		tvTermsAndCodition = (TextView) findViewById(R.id.tvtermsCondition);
		btn_ok = (Button) findViewById(R.id.btnOk);
		btn_ok.setOnClickListener(this);
		this.mContext = context;
		tvTermsAndCodition.setText(Html.fromHtml(context.getResources().getString(
                R.string.appNameBold)
                + " "
                + context.getResources().getString(R.string.TermsCondition1)
                + context.getResources().getString(R.string.appNameBold)
                + " "
                + context.getResources().getString(R.string.TermsCondition2)
                + context.getResources().getString(R.string.appNameBold)
                + " "
                + context.getResources().getString(R.string.TermsCondition3)
                + context.getResources().getString(R.string.appNameBold)
                + " "
                + context.getResources().getString(R.string.TermsCondition4)));
	}

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		switch (v.getId()) {
		case R.id.btnOk:
			dismiss();
			break;

		default:
			break;
		}
	}

}
